﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ActiveReportsDemo.Reports;

namespace ActiveReportsDemo.Viewers
{
    public partial class PerformanceViewer : DemoBaseUserControl
    {
        public PerformanceViewer()
        {
            InitializeComponent();

            viewer1.LoadCompleted += new GrapeCity.ActiveReports.Document.LoadCompletedEventHandler(viewer1_LoadCompleted);
        }

        void viewer1_LoadCompleted(object sender, EventArgs e)
        {
            
        }

        public override void ShowReport(string name)
        {
            
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
            switch (CurrentReport)
            {
                case "rptPerformance":
                    rptPerformance rpt10 = new rptPerformance();
                    System.Data.DataTable dt = new DataTable();
                    dt.Columns.Add("Col1");

                    for (int r = 1; r <= 20000; r++)
                    {
                        dt.Rows.Add(r);
                    }
                    rpt10.DataSource = dt;
                    viewer1.Document = rpt10.Document;
                    rpt10.Run(true);
                    break;   
                default:
                    break;
            }

        }
    }
}
